<div class="modal" id="ban-modal" data-bs-backdrop="static">
  <div class="modal-dialog">
    <div class="modal-content">
      <%= form_for('', url: action_topic_path(topic, type: "ban"), method: "POST", remote: true) do |f| %>
        <div class="modal-header">
          <div class="modal-title"><%= t("topics.ban_title") %></div>
          <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
        </div>
        <div class="modal-body">
          <div class="mb-3">
            <select class="form-control" onchange="$('#ban-modal textarea').val($(this).val())" name="reason">
              <option value="" selected><%= t("topics.ban_directly") %></option>
              <% Setting.ban_reasons.each do |str| %>
                <option value="<%= str %>"><%= str %></option>
              <% end %>
            </select>
          </div>
          <div>
            <label><%= t("topics.ban_with_reason") %></label>
            <textarea class="form-control" name="reason_text" rows="4"></textarea>
          </div>
        </div>
        <div class="modal-footer">
          <button type="submit" class="btn btn-primary"><%= t("common.ok") %></button>
          <a class="btn btn-secondary" data-bs-dismiss ="modal"><%= t("common.cancel") %></a>
        </div>
      <% end %>
    </div>
  </div>
</div>
